using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

    class Room : MonoBehaviour
    {
        
        public void RoomGen(BSPNode room)
        {
		int a =splitCountString;
		for (int i = 0; i < a  ; i++);
		RoomID = i;
      
		int mirw = .5;
			int mar = .75;
		int mrw = mirw * MapWidth;
		int mrh = mirw * MapHeight;
		int marw =  mar * MapWidth;
		int marh =  mar * MapHeight;
		

            int fxbegin = (int)Math.Ceil((room.LeftEdge * MapWidth) + 1);
            int fybegin = (int)Math.Ceil((room.TopEdge * MapHeight) + 1);
            int fxroommax = (int)((room.RightEdge * MapWidth) - 1);
            int fyroommax = (int)((room.BottomEdge * MapHeight) - 1);
            int froomWidth = fxroommax - fxbegin;
            int froomHeight = fyroommax - fybegin;

            int xWidth = RandomValueBetween(Math.Min(mrw, froomWidth), froomWidth);
            int yHeight = RandomValueBetween(Math.Min(mrh, froomHeight), froomHeight);

            int xRoomStart = (MapWidth - xWidth);
            int yRoomStart = (MapHeight - xHeight);
            
          
		    Texture2D MyTexture = Resources.Load("WhiteTexture") as Texture2D;
    		GUI.color = new Color(1, 0.92, 0.016, 1);
    		GUI.DrawTexture(new Rect(xRoomStart-1, yRoomStart-1 , xWidth, xHeight), MyTexture);
    		GUI.color = Color.white;
        {
            
         
	}

        
    }

}